<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('debug', 'Roles');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="role-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a(Yii::t('debug', 'Create'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            // 'id',
            'name',
            'type',
            'created_at',
            'updated_at',

            ['class' => 'yii\grid\ActionColumn',
            'template'=>'{view} {update} {delete}',
            'buttons' => [
                'view' => function($url, $model){
                    return Html::a('添加權限', $url, ['class'=>'btn btn-default']);
                }
            ],
            ],
        ],
    ]); ?>
</div>
